home *** CD-ROM | disk | FTP | other *** search
- //wake in water particle shader
- //should be used with prtWake2.vsh
- //Luke Lenhart
- //(C)2004-2005 Digipen Institute of Technology
-
- //time since whenever
- float time;
-
- //
- struct PS_INPUT
- {
- float2 Side : TEXCOORD0; //side of particle model is on (-1 to 1) (.xy)
- float4 Clr : COLOR;
- };
-
- float4 PShader(PS_INPUT In) : COLOR
- {
- //calc wave alpha
- float alpha=sin(In.Side.x*23+time) + sin(In.Side.y*11+sin(In.Side.x*13+time))*.5f;
-
- //fade towards edges
- alpha*=sqrt(saturate(1.0f-distance(float2(0,0),In.Side.xy)));
-
- //make final color
- float4 clr=In.Clr;
- clr.a*=alpha;
-
- return clr;
- }
-